package impl;

import app.Pojo_arry;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import impl.Province.JsonTest;

import java.util.*;


public class Impl_6 {
    static Random rd = new Random();
 // static String path = JsonTest.class.getClassLoader().getResource("a.json").getPath();
 // static JSONObject jsonObject = JSON.parseObject(JsonTest.readJsonFile(path));
 // static Object[] province = jsonObject.keySet().toArray();
 // static String s = province[rd.nextInt(province.length)].toString();
    static String city=null;

    public Integer addfont_size() {
        Integer[] values = {11, 12, 14, 15, 16, 10};

        return values[rd.nextInt(values.length)];
    }

    public String addcategory_id() {
        String[] values = {"1", "2", "3", "4", "5", "6"};
        return values[rd.nextInt(values.length)];
    }

    public String addstat_id() {
        String[] values = {"1", "2", "3", "4", "5", "6"};
        return values[rd.nextInt(values.length)];
    }

    public String addvoice_id() {
        String[] values = {"10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"};
        return values[rd.nextInt(values.length)];
    }

    public String addspeed() {
        String[] values = {"1.0", "1.5", "0.5", "2.0", "3.0", "0.75", "2.5", "1.75"};
        return values[rd.nextInt(values.length)];
    }

    public String addvoice_type() {
        String[] values = {"女声", "男声"};
        return values[rd.nextInt(values.length)];
    }

    public Long addreqdur() {
        Long[] values = {5l, 7l, 3l, 10l, 8l, 15l, 20l, 15l};
        return values[rd.nextInt(values.length)];
    }

    public Integer addclient_version_code() {
        Integer[] values = {11, 5, 14, 6, 8, 10, 12, 14};
        return values[rd.nextInt(values.length)];
    }

    public String addcountry() {
        return "中国";
    }

    public String addprovince() {
        String path = JsonTest.class.getClassLoader().getResource("a.json").getPath();
        JSONObject jsonObject = JSON.parseObject(JsonTest.readJsonFile(path));
        Object[] province = jsonObject.keySet().toArray();
        //省
        String s = province[rd.nextInt(province.length)].toString();

        Object[] citys = jsonObject.getJSONArray(s).toArray();
         city = citys[rd.nextInt(citys.length)].toString();
        return s;
    }

    public String addcity() {
        return city;
    }

    public String addips() {
        String[] values = {"三星", "友达", "熊猫", "京东方", "LG"};
        return values[rd.nextInt(values.length)];
    }

}
